#/usr/bin/bash

scp_and_move(){
    cd /c/fc3.0/orders/nginx/html/tt-orders/2020
    for file in `ls FC4-M* 2>/dev/null`
    do
        if test -f $file
        then
            echo "file:  $file"
            scp $file www@mall.foodtrust.cn:~/fc4/public/uploads/orders
            #mv $file $1
        #elif test -d $file
        #then
        #    echo "path: $file"
        fi
    done
}

COUNTER=0
while [ $COUNTER -lt 1 ]
do
    THIS_TIME=`date`
    echo "[$THIS_TIME] scp pickup text to remote"
    scp_and_move "copied" 
    sleep 300
done
